package org.bennedum.SimpleMCClient.protocol;

/**
 *
 * @author frdfsnlght <frdfsnlght@gmail.com>
 */
public final class Packet01 extends Packet {
    
    public Packet01(byte[] input) {
        String str = getString16(input, 5);
        setBuffer(input, 0, 16 + (2 * str.length()));
    }
 
    public Packet01(int protoVersion, String username) {
        super(0x01, 16 + (2 * username.length()));
        setInt(buffer, 1, protoVersion);
        setString16(buffer, 5, username);
        setLong(buffer, 7 + (2 * username.length()), 0L);
        setByte(buffer, 15 + (2 * username.length()), (byte)0);
    }
    
}
